/**
 * Created by lwy on 2017/6/15.
 */

$(function(){
    $.ajax({
        url:'/accountC/getAccountSurvey.json',
        dataType:'json',
        data:{
            token:getItem('token'),
        },
        type:'post',
        success:function(data){
            if(data.code==-1){
               window.location.href="login.html";
            }
            if(data.code==0){
                mui.toast(data.msg);
            }
            if(data.code==1){
                var data = data.datas;
                if(data.userTypeValue=='2'){
                    $('#makeorderBox').show();
                    $('#makeorder').html(data.shopOrder+" 元");
                    //$('#dingdangBox').show();
                    $('#sdd').html(data.cdd+" 个");
                }
                if(data.userTypeValue=='5'){
                    $('#makeorderBox').show();
                    $('#makeorder').html(data.shopOrder+" 元");
                    $('#sdd').html(data.cdd+" 个");
                }
                if(data.userTypeValue=='1'){
                    $('#makeorderBox').hide();
                    $('#sdd').html(data.cdd+" 个");
                }

                $('#order').html(data.order+" 元");
                $('#withdraw').html(data.tiXianMoney+" 元");
                $('#dd').html(data.sdd+"个");
                $('#balance').html(data.accountMoney+" 积分");
            }
        }
    })
})

function omit(omitt){
    if(omitt>10000){
        omitt=(omitt/10000).toFixed(2)+'万';
    }else{
        omitt=omitt;
    }
    return omitt;
}